import { Plane, Sphere, Camera, Vector3, Phong, Color, Union, Checker, Ray3 } from "@script/index";

export const $ = (element = '') => document.querySelector(element);
export const vec3 = (x: number, y: number, z: number) => new Vector3(x, y, z);
export const sphere = (center: Vector3, radius: number) => new Sphere(center, radius);
export const plane = (v: Vector3, d: number) => new Plane(v, d);
export const phong = (diffuse: Color, specular: Color, shininess: number, reflectiveness?) =>
  new Phong(diffuse, specular, shininess, reflectiveness);
export const union = (geometries: Array<Plane | Sphere>) => new Union(geometries);
export const checker = (scale: number, reflectiveness?) => new Checker(scale, reflectiveness);
export const ray3 = (origin: Vector3, direction: Vector3) => new Ray3(origin, direction);
export const camera = (eye: Vector3, front: Vector3, ref_up: Vector3, fov: number) =>
  new Camera(eye, front, ref_up, fov);